<template>
  <div class="container">
    <header class="center">{{ym}}评价报告内部审核人员汇总管理</header>
    <main>
      <div class="center mt15">全部 人员</div>
      <div class="flex mt15">
        <section class="left">
          <el-button type="primary" size="mini" style="margin:30px auto;">打印</el-button>
          <el-button type="primary" size="mini" style="margin:30px auto;">导入</el-button>
          <el-button type="primary" size="mini" style="margin:30px auto;">历史数据</el-button>
        </section>
        <section class="right">{{ymd}}</section>
      </div>
    </main>
    <el-table v-loading="loading" :data="tableData" align="center" border style="width: 100%">
      <el-table-column label="序号" align="center" width="180" prop="id"></el-table-column>
      <el-table-column align="center" label="项目类型" width="180" prop="name"></el-table-column>
      <el-table-column align="center" label="项目数量" width="180" prop="person"></el-table-column>
      <el-table-column align="center" label="完成金额" width="180" prop="person"></el-table-column>
      <el-table-column align="center" label="应得提成" width="180" prop="person"></el-table-column>
      <el-table-column align="center" label="同期对比%" width="180" prop="person"></el-table-column>
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">
          <el-button size="mini" @click="detail(scope.$index, scope.row)">详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <v-pagination
      @page-change="pageChange"
      class="p"
      v-show="page"
      @page-size-change="pageSizeChange"
      :total="total"
      :page-size="pageSize"
      :layout="['total', 'prev', 'pager', 'next', 'sizer', 'jumper']"
    ></v-pagination>
  </div>
</template>

<script>
import request from "@/utils/request";
import { getToken, getid, getlevel } from "@/utils/auth";
import { ymd, ym } from "@/api/date";
export default {
  name: "accessPeopleAdmin",
  data() {
    return {
      page: false,
      loading: false,
      pageIndex: 1,
      pageSize: 10,
      total: 1,
      tableData: [],
      ymd: ymd(),
      ym: ym()
    };
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      var that = this;
      request(`/quality/selectevalist`, {
        method: "get",
        headers: {
          "Content-Type": "application/json",
          token: getToken(),
          type: 1
        },
        params: ""
      })
        .then(res => {
          console.log(res);
          that.tableData = res.data.object;
        })
        .catch(e => {
          console.log(e);
        });
    },
    findList() {
      var resdata = {
        cid: getid(),
        did: "",
        itemType: "",
        level: getlevel(),
        page: 1,
        pageSize: 20,
        sort: "",
        uid: "",
        staff: ""
      };
      request(`/quality/selectevalist`, {
        method: "get",
        headers: {
          "Content-Type": "application/json",
          token: getToken(),
          type: 1
        },
        params: resdata
      })
        .then(res => {
          console.log(res);
        })
        .catch(e => {
          console.log(e);
        });
    },
    pageChange(pageIndex) {
      this.pageIndex = pageIndex;
      this.findList();
      console.log(pageIndex);
    },
    pageSizeChange(pageSize) {
      this.pageIndex = 1;
      this.pageSize = pageSize;
      this.findList();
    }
  }
};
</script>

<style scope>
.p {
  margin-top: 18px !important;
}
.container {
  padding: 15px;
  font-weight: 400;
  color: #606266;
}
header {
  font-size: 19px;
}
.flex {
  display: flex;
  justify-content: space-between;
}
.mt15 {
  margin-top: 15px;
}
.center {
  text-align: center;
}
</style>
